﻿@model Romantics.Models.WidgetViewModel
@using Romantics
@{
    var url = ((string)ViewContext.RouteData.Values["url"]);
    int? selected = String.IsNullOrEmpty(ViewBag.Year) ? null : Int16.Parse(ViewBag.Year);
    var Controller = ((string)ViewContext.RouteData.Values["Controller"]).ToLower();
    var Action = Model.Action;
    switch(Controller)
    {
        case "hike":
           Controller = "archive";
           Action = "index";
           break;
        case "archive":
           Action = (Action == "report") ? "index" : Action;
           break;
    }
}
<!-- Widget to display categories in sidebar -->
<div class="tags sidebar">
  @if (Model.Years.Count > 0)
  {
      <h3>Хронология</h3>
      foreach (var year in Model.Years)
      {
        @Html.YearLink(year, Controller, Action, url, selected)
      }
  }
</div>
